Lesson 2 - Variables and data types
Quiz
Which of these would assign the value 12 to variable x
- y = 12
x = y - 12 = x
- y = 10 + 2
x = y - 2 - 12 = y
x = y
What does the term casting mean?
- Changes the data type of a variable
- Convert a variable from one data type to another
- Hides the data type of a variable
- Interviews people for my latest movie :)
Which of these would cast the string "40" to a integer?
- cast("40")
- cast(40)
- cast = "40"
- int("40")
What type of value would a real store?
- Any real (not made up) value
- Whole numbers
- Decimal numbers
- Text
What values would the data type integer store?
- Whole numbers
- Decimal numbers
- Values which are prime numbers
- money values
Translate this line into english -
x = 1
- X equals 1
- x is assigned the value of 1
- x and 1 are now the same